package Homework;
//学生类
public class Student implements Comparable<Student>{
	private String name;
	private String gender;
	private int score;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getGender() {
		return gender;
	}
	public void setGender(String gender) {
		this.gender = gender;
	}
	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}
	public Student(String name, String gender, int score) {
		super();
		this.name = name;
		this.gender = gender;
		this.score = score;
	}
	public Student() {
		super();
	}
	@Override
	public String toString() {
		return "学生姓名：" + name + ", 性别：" + gender + ", 成绩：" + score;
	}
	//重写compareTo方法，降序排列
	public int compareTo(Student other) {
		if(this.score>other.score) {
			return -1;
		}else if (this.score<other.score) {
			return 1;
		}
		return 0;
	}
}
